package com.zondy.mapgis.domain.psmap;

import com.zondy.mapgis.common.core.annotation.Excel;
import com.zondy.mapgis.common.core.annotation.Excel.ColumnType;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Arrays;

@Schema(
   name = "应用权限对象"
)
public class AppPermission {
   @Schema(
      description = "角色ID"
   )
   @Excel(
      name = "角色序号",
      cellType = ColumnType.NUMERIC
   )
   private Long roleId;
   @Schema(
      description = "数据目录树选择项是否关联显示（ 0：父子不互相关联显示 1：父子互相关联显示）"
   )
   private boolean dataCheckStrictly;
   @Schema(
      description = "数据组"
   )
   private Long[] dataIds;
   @Schema(
      description = "微件组"
   )
   private String[] appWidgetsIds;

   public Long getRoleId() {
      return this.roleId;
   }

   public boolean isDataCheckStrictly() {
      return this.dataCheckStrictly;
   }

   public Long[] getDataIds() {
      return this.dataIds;
   }

   public String[] getAppWidgetsIds() {
      return this.appWidgetsIds;
   }

   public AppPermission setRoleId(Long roleId) {
      this.roleId = roleId;
      return this;
   }

   public AppPermission setDataCheckStrictly(boolean dataCheckStrictly) {
      this.dataCheckStrictly = dataCheckStrictly;
      return this;
   }

   public AppPermission setDataIds(Long[] dataIds) {
      this.dataIds = dataIds;
      return this;
   }

   public AppPermission setAppWidgetsIds(String[] appWidgetsIds) {
      this.appWidgetsIds = appWidgetsIds;
      return this;
   }

   public boolean equals(Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof AppPermission)) {
         return false;
      } else {
         AppPermission other = (AppPermission)o;
         if (!other.canEqual(this)) {
            return false;
         } else if (this.isDataCheckStrictly() != other.isDataCheckStrictly()) {
            return false;
         } else {
            label33: {
               Object this$roleId = this.getRoleId();
               Object other$roleId = other.getRoleId();
               if (this$roleId == null) {
                  if (other$roleId == null) {
                     break label33;
                  }
               } else if (this$roleId.equals(other$roleId)) {
                  break label33;
               }

               return false;
            }

            if (!Arrays.deepEquals(this.getDataIds(), other.getDataIds())) {
               return false;
            } else {
               return Arrays.deepEquals(this.getAppWidgetsIds(), other.getAppWidgetsIds());
            }
         }
      }
   }

   protected boolean canEqual(Object other) {
      return other instanceof AppPermission;
   }

   public int hashCode() {
      boolean PRIME = true;
      int result = 1;
      result = result * 59 + (this.isDataCheckStrictly() ? 79 : 97);
      Object $roleId = this.getRoleId();
      result = result * 59 + ($roleId == null ? 43 : $roleId.hashCode());
      result = result * 59 + Arrays.deepHashCode(this.getDataIds());
      result = result * 59 + Arrays.deepHashCode(this.getAppWidgetsIds());
      return result;
   }

   public String toString() {
      return "AppPermission(roleId=" + this.getRoleId() + ", dataCheckStrictly=" + this.isDataCheckStrictly() + ", dataIds=" + Arrays.deepToString(this.getDataIds()) + ", appWidgetsIds=" + Arrays.deepToString(this.getAppWidgetsIds()) + ")";
   }
}
